package org.indp.mongowl.ui.container;

import com.vaadin.data.Property;
import org.bson.types.ObjectId;

/**
 *
 */
public class ObjectIdProperty implements Property<ObjectId> {

    private final ObjectId objectId;

    public ObjectIdProperty(ObjectId objectId) {
        this.objectId = objectId;
    }

    @Override
    public ObjectId getValue() {
        return objectId;
    }

    @Override
    public void setValue(ObjectId newValue) throws ReadOnlyException {
        throw new ReadOnlyException();
    }

    @Override
    public Class<? extends ObjectId> getType() {
        return ObjectId.class;
    }

    @Override
    public boolean isReadOnly() {
        return true;
    }

    @Override
    public void setReadOnly(boolean newStatus) {
    }
}
